package cn.tedu.personnel.service.impl;

import cn.tedu.personnel.mapper.UserMapper;
import cn.tedu.personnel.pojo.dto.UserParam;
import cn.tedu.personnel.pojo.dto.UserQuery;
import cn.tedu.personnel.pojo.entity.User;
import cn.tedu.personnel.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.Date;
import java.util.List;

@Slf4j
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> select(UserQuery userQuery) {
        return userMapper.select(userQuery);
    }

    @Override
    public void insert(UserParam userParam) {
        User user = new User();
        BeanUtils.copyProperties(userParam,user);
        user.setReviewStatus("待审批");
        user.setCreateTime(new Date());
        userMapper.insert(user);
    }

}

